<div ng-controller="printerCtrl">
    <div class="bg-light lter b-b wrapper-md ng-scope">
        <h4 class="m-n font-thin">打印机模板管理</h4>
    </div>
    <div class="wrapper-md">
        <div class="panel-body panel-default panel">
            <div class="b-a">
                <div class="panel-body panel m-n b-b">
                    <a class="b-a b-success btn btn-sm text-success h6 m-r-sm" ng-click="openAddPoup()">新建打印机</a>
                    <a class="b-a b-success btn btn-sm text-success h6 m-r-sm" ui-sref="app.printerTemplate">打印小票管理</a>
                    <span class="text-muted h6">适用于有线下门店的商家，配置小票打印机进行接单、备货、配送流程。网页版仅支持连接WiFi打印机</span>
                </div>
                <div class="bg-white">
                    <div>
                        <table class="table table-striped bg-white h6 m-n">
                            <thead>
                            <tr>
                                <th>名称</th>
                                <th>类型</th>
                                <th>纸张宽度</th>
                                <th>备注</th>
                                <th>终端号</th>
                                <th>小票模板</th>
                                <th>一次打印张数</th>
                                <th>打印机状态</th>
                                <th width="210">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in list">
                                <td>{{item.name}}</td>
                                <td>
                                    <span ng-if="item.printerType==0">易联云</span>
                                </td>
                                <td>
                                    <span ng-if="item.paperWidthType==0">58mm</span>
                                </td>
                                <td>{{item.remarks}}</td>
                                <td>{{item.deviceNumber}}</td>
                                <td>{{item.printerTemplateName}}</td>
                                <td>{{item.number}}</td>
                                <td>
                                    <span class="label label-default" ng-if="item.status==0">离线(请手动重启打印机)</span>
                                    <span class="label label-success" ng-if="item.status==1">在线</span>
                                    <span class="label label-info" ng-if="item.status==2">缺纸</span>
                                </td>
                                <td>
                                    <button class="btn btn-info btn-sm" ng-click="openEditPoup(item.id)">修改</button>
                                    <button class="btn btn-danger btn-sm" ng-click="del(item.id,item.name)">删除</button>
                                    <button class="btn btn-primary btn-sm" ng-click="openSetPoup(item.id)">设置</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                        <span class="h6">~未搜索到任何数据~</span>
                    </div>
                    <div>
                        <circle-loading ng-if="app.loading"></circle-loading>
                    </div>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="col-sm-offset-4 col-sm-4 text-center">
                            <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                        </div>
                        <div class="col-sm-4 text-right text-center-xs">
                            <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                        ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                        previous-text="上一页" next-text="下一页"
                                        first-text="首页" last-text="尾页"></pagination>
                        </div>
                    </div>
                </footer>
            </div>
        </div>
    </div>
</div>